package com.leyou.item.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leyou.item.entity.TbBrand;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 品牌表，一个品牌下有多个商品（spu），一对多关系 Mapper 接口
 * </p>
 *
 * @author HM
 * @since 2020-10-07
 */
public interface TbBrandMapper extends BaseMapper<TbBrand> {

    @Select("SELECT a.* FROM tb_brand a,tb_category_brand b WHERE b.category_id=#{cid} AND a.id = b.brand_id")
    List<TbBrand> selectBrandByCid(Long cid);
}
